#include <testngpp/testngpp.hpp>
#include <mockcpp/mokc.h>
#include <mockcpp/mockcpp.hpp>

#include <adder.h>

struct Interface 
{
    virtual int func() = 0;
    virtual ~Interface(){}
};

FIXTURE(Adder, base test)
{
    MockObject<Interface> mocker;

	TEST(1 + 2 => 3)
	{
	    ASSERT_EQ(3, add(1, 2));
	}
	
	TEST(mockcpp global mocker test)
	{
	    MOCKER(add)
		  .stubs()
		  .will(returnValue(200));
		ASSERT_EQ(200, add(1, 2));

        GlobalMockObject::verify();
	}

    TEST(mockcpp mock object test)
    {        
        MOCK_METHOD(mocker, func)
            .expects(once())
            .will(returnValue(3));
        ASSERT_EQ(3, mocker->func());
        mocker.verify();
    }
};

FIXTURE(DataDrivenTest)
{
	DATA_PROVIDER( mydata, 3
		, DATA_GROUP(1, 2, 3) 
		, DATA_GROUP(77, 20, 97) 
		, DATA_GROUP(101, 503, 604));

	// @test(data="mydata")
	PTEST( (int a, int b, int c), this is a parametered() test)
	{
		ASSERT_EQ(c, add(a, b));
	}
};

